package rhc.taskSchedule.entity;

import java.util.HashMap;
import java.util.Map;

/**运行状态
 * @author lenovo
 *
 */
public enum RunningStatus {
	RUN(1,"正在运行"),CREATE(0,"刚创建"),PAUSE(2,"暂停运行"),STOP(3,"停止运行"),ERROR(4,"运行错误");
	
	public int status;
	public String desc;
	
	RunningStatus(int status,String desc){
		this.status=status;
		this.desc=desc;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	private static final Map<Integer,RunningStatus> status_RunningStatus=new HashMap<Integer,RunningStatus>();
	static{
		for(RunningStatus rs:RunningStatus.values()){
			status_RunningStatus.put(rs.status, rs);
		}
	}
	
	/**
	 * @param status
	 * @return
	 */
	public static RunningStatus getRSByStatus(int status){
		return status_RunningStatus.get(status);
	}
}
